function dx = plant(t, x)
    dx = zeros(18, 1);
%***************************系统参数**************************************
    b0 = 10;    beta = 0.8;     beta1 = 150;    beta2 = 8;
    % rw = 0.2;   rh = 0.02;
    rw = 100;   rh = 60;
    p = 7;  q = 5;
    lamda = 0.5;    ksai = 0.02;
    D = 0.1;
%***************************系统状态**************************************
    % x = [x1; x2; x3] 对应扩展状态
    x1 = x(1);  % 状态变量
    x2 = x(2);  % 状态导数
    x3 = x(3);  % 扩展状态变量（扰动）
    
    x1_hat = x(4);  % 状态变量估计值
    x2_hat = x(5);  % 状态导数估计值
    x3_hat = x(6);  % 扩展状态变量估计值（扰动）
    
   
    x_hat = [x1_hat; x2_hat; x3_hat];
    Q_hat = [x(7) x(8) x(9); x(10) x(11) x(12); x(13) x(14) x(15)];
    W_hat = [x(16); x(17); x(18)];
%***************************期望值****************************************
    xg = sin(t);   dxg = cos(t);   ddxg = -sin(t);
%***************************估计与实际值之间的误差*************************
    e1_hat = xg - x1_hat;       dot_e1_hat = dxg - x2_hat;
%***************************状态与实际值之间的误差*************************
    e1 = xg - x1;   dot_e1 = dxg - x2;
%***************************估计误差**************************************
    e = x1 - x1_hat;
%***************************滑模面****************************************
    s = dot_e1 + beta * e1^(q/p);
    % es = beta*q/p * ( dot_e1 * e1^(q/p-1) - dot_e1_hat * e1_hat^(q/p-1);
    % ds = x3_hat - x3 + beta*q/p * ( dot_e1 * e1^(q/p-1) - dot_e1_hat * e1_hat^(q/p-1) );
%***************************控制输入**************************************
    u = 1 / b0 * ( ddxg - x3_hat + beta * q / p * e1_hat^(q/p-1) * dot_e1_hat );
    
    % 状态方程
    dx(1) = x2;
    dx(2) = x3 + b0 * u;  % 输入控制量
    dx(3) = 2*pi*3*cos(2*pi*t);  % 扰动变化率

    dx(4) = x2_hat + beta1 * e;
    dx(5) = x3_hat - beta2 * fal(e, lamda, ksai) + b0 * u;
    dx(6) = adaptive_neural_network(x_hat, W_hat, Q_hat);

    
    dW_hat = -s * ( h(Q_hat' * x_hat) - dh(Q_hat' * x_hat) * Q_hat' * x_hat + D ) - rw*W_hat;
    dQ_hat = -s * W_hat' * dh(Q_hat' * x_hat) * x_hat - rh * Q_hat;

    dx(7)  = dQ_hat(1);dx(8)  = dQ_hat(2);dx(9)  = dQ_hat(3);
    dx(10) = dQ_hat(4);dx(11) = dQ_hat(5);dx(12) = dQ_hat(6);
    dx(13) = dQ_hat(7);dx(14) = dQ_hat(8);dx(15) = dQ_hat(9);

    dx(16) = dW_hat(1);
    dx(17) = dW_hat(2);
    dx(18) = dW_hat(3);


    % dt = 3*sin(2*pi*t); 
    % dx(1) = x2;
    % dx(2) = -25*x1 + 133 * u + dt;
end
